package com.example.smartcommunity;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RadioButton;

import com.example.smartcommunity.com.com.lxf.feagment.AdviceFragment;
import com.example.smartcommunity.com.com.lxf.feagment.GgwxFragment;
import com.example.smartcommunity.com.com.lxf.feagment.JjwxFragment;
import com.example.smartcommunity.com.com.lxf.feagment.TousuFragment;

import static com.example.smartcommunity.R.*;
import static com.example.smartcommunity.R.id.*;

public class WxfwActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(layout.layout_wxfw);
        ImageView iv_back=findViewById(back2);
        RadioButton btn_jjwx=findViewById(id.btn_jjwx);
        RadioButton btn_ggwx=findViewById(R.id.btn_ggwx);
        final FrameLayout f3=findViewById(id.f3);
        iv_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        btn_jjwx.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                f3.removeAllViews();
                FragmentTransaction transaction= getSupportFragmentManager().beginTransaction();
                transaction.replace(id.f3 , new JjwxFragment());
                transaction.commit();
            }
        });
        btn_ggwx.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                f3.removeAllViews();
                FragmentTransaction transaction= getSupportFragmentManager().beginTransaction();
                transaction.replace(id.f3 , new GgwxFragment());
                transaction.commit();
            }
        });





    }
}
